package com.sugar.follow.up.module.business.dal.mysql.patienthl;

import com.sugar.follow.up.framework.common.pojo.PageResult;
import com.sugar.follow.up.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.sugar.follow.up.framework.mybatis.core.mapper.BaseMapperX;
import com.sugar.follow.up.module.business.controller.admin.patient.hl.vo.PatientHlPageReqVO;
import com.sugar.follow.up.module.business.dal.dataobject.patienthl.PatientHlDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 化疗 Mapper
 *
 * @author Ysugar
 */
@Mapper
public interface PatientHlMapper extends BaseMapperX<PatientHlDO> {

    default PageResult<PatientHlDO> selectPage(PatientHlPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PatientHlDO>()
                .eqIfPresent(PatientHlDO::getPatientId, reqVO.getPatientId())
                .likeIfPresent(PatientHlDO::getPatientName, reqVO.getPatientName())
                .eqIfPresent(PatientHlDO::getDoctorId, reqVO.getDoctorId())
                .likeIfPresent(PatientHlDO::getDoctorName, reqVO.getDoctorName())
                .betweenIfPresent(PatientHlDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PatientHlDO::getId));
    }

}